package com.hspedu.tankgame04;

import java.util.Vector;

public class HeroTank extends Tank {
    Shot shot = null;
    Vector<Shot> shots = new Vector<>();
    public HeroTank(int x, int y) {
        super(x, y);
    }

    public void shotEnemyTank() {
        if (shots.size() == 5) { //控制最大子弹数
            return;
        }

        this.shot = super.createShot(); //创建子弹对象

        shots.add(shot);
        //启动shot线程
        new Thread(shot).start();
    }
}
